import pyautogui
import time
import pyperclip

pyperclip.copy("你好,世界\n")
pyautogui.PAUSE = 0.2  # 设置全局暂停 0.2 秒
region = pyautogui.locateCenterOnScreen('my_folder/qq1.png', grayscale=True)
pyautogui.moveTo(region.x / 2, region.y/2, duration=0.25)
pyautogui.leftClick(region.x / 2, region.y/2, duration=0.25)
touxiang = pyautogui.locateCenterOnScreen('my_folder/touxiang.png')
pyautogui.moveTo(touxiang.x / 2 + 100, touxiang.y/2+200, duration=0.25)
pyautogui.scroll(1000)
time.sleep(2)
def getmeImg():
  try:
    meImg = pyautogui.locateCenterOnScreen('my_folder/meImg.png')
    print('找到啦！！！', meImg)
    pyautogui.leftClick(meImg.x / 2, meImg.y/2)
    # pyautogui.write("")
    pyautogui.hotkey('command', 'v')
    time.sleep(1)
    pyautogui.press('enter')
    return
  except:
    pyautogui.scroll(-5)
    print('未找到您！！！！')
    getmeImg()
getmeImg()
